import React, {Component} from 'react';
import {observer} from 'mobx-react';

import ReIcon from 'components/widgets/ReIcon';
import ReButton from 'components/widgets/ReButton';
import './Empty.less';

export default class Empty extends Component {

    static propTypes = {}
    static defaultProps = {}

    //$$.LN.HAS_NO_EXHIBITION 对应默认的字段
    render() {
        const {alwayShow, icon, tips, createBtns, btnLabels} = this.props;
        return <div className='empty-wrapper'>
            <div className="icon-empty-wrapper">
                <ReIcon className='icon' icon={icon ? icon : 'blank_page'}/>
            </div>
            <div className="txt">
                {tips || '当前还没任何画展'}
            </div>
            {
                (!!createBtns || !!btnLabels) &&
                <ReButton className={alwayShow ? 'create-ex alway' : 'create-ex'} label={btnLabels || '创建画展'}
                          onClick={this.handleClick}/>
            }
        </div>


    }

    handleClick = () => {
        this.props.onClick();
    }

}
